import { Injectable } from '@angular/core';
import { _HttpClient } from '@delon/theme';

@Injectable({
  providedIn: 'root'
})
export class TallyCheckService {

	ostUrl = 'tjpn4-handle-tally/oneStockTally/';
	tstUrl = 'tjpn4-handle-tally/twoStockTally/';
	bulkUrl = 'tjpn4-handle-tally/bulkTally/';
	api = {
		ostTallyCheckPage: this.ostUrl + 'checkPage',
		ostChangeIsCheck: this.ostUrl + 'changeIsCheck?id=',
		ostCorrectPieceTon: this.ostUrl + 'correctPieceTon',
		ostShipStatDetail: this.ostUrl + 'shipStatCheckDetail',

		tstTallyCheckPage: this.tstUrl + 'checkPage',
		tstChangeIsCheck: this.tstUrl + 'changeIsCheck?id=',
		tstCorrectPieceTon: this.tstUrl + 'correctPieceTon',
		tstShipStatDetail: this.tstUrl + 'shipStatCheckDetail',

		bulkTallyCheckPage: this.bulkUrl + 'checkPage',
		bulkChangeIsCheck: this.bulkUrl + 'changeIsCheck?id=',
		bulkCorrectTon: this.bulkUrl + 'correctTon',
	};
	constructor(private http: _HttpClient) {
	}

	ostTallyCheckPage(params: any) : any {
		return this.http.get(this.api.ostTallyCheckPage, params);
	}

	ostCorrectPieceTon(postData: any) : any {
		return this.http.post(this.api.ostCorrectPieceTon, postData);
	}

	ostChangeIsCheck(id: any): any {
		return this.http.post(this.api.ostChangeIsCheck + id);
	}

	ostShipStatDetail(params: any): any {
		return this.http.get(this.api.ostShipStatDetail, params);
	}

	tstTallyCheckPage(params: any) : any {
		return this.http.get(this.api.tstTallyCheckPage, params);
	}

	tstCorrectPieceTon(postData: any) : any {
		return this.http.post(this.api.tstCorrectPieceTon, postData);
	}

	tstChangeIsCheck(id: any): any {
		return this.http.post(this.api.tstChangeIsCheck + id);
	}

	tstShipStatDetail(params: any): any {
		return this.http.get(this.api.tstShipStatDetail, params);
	}


	bulkTallyCheckPage(params: any) : any {
		return this.http.get(this.api.bulkTallyCheckPage, params);
	}

	bulkCorrectTon(postData: any) : any {
		return this.http.post(this.api.bulkCorrectTon, postData);
	}

	bulkChangeIsCheck(id: any): any {
		return this.http.post(this.api.bulkChangeIsCheck + id);
	}
}
